package com.sls.web.manager.action.recharge;

import javax.annotation.Resource;

import com.sls.web.manager.action.SuperAction;
import com.sls.web.manager.common.Constants;
import com.sls.web.manager.page.Pagination;
import com.sls.web.manager.recharge.pojo.Priority;
import com.sls.web.manager.recharge.pojo.SupplierRechargeMode;
import com.sls.web.manager.recharge.querybean.PriorityQuery;
import com.sls.web.manager.recharge.service.PriorityService;

public class PriorityAction extends SuperAction {
	private static final long serialVersionUID = 5007938188364039878L;

	@Resource(name = "priorityService")
	private PriorityService priorityService;

	private PriorityQuery priorityQuery;
	private Pagination<Priority> page;
	private Priority priority;
	private SupplierRechargeMode srm;
	private Boolean msg;

	public String list() throws Exception {
		// 查询Info
		if (priorityQuery == null) {
			priorityQuery = new PriorityQuery();
			priorityQuery.setCurrentPage(Constants.INIT_CURRENTPAGE);
			priorityQuery.setPageSize(Constants.INIT_PAGESIZE);
		}
		page = priorityService.queryPage(priorityQuery, getCurrentOperator());
		if (page == null) {
			page = new Pagination<Priority>();
		}
		return "list";
	}

	public String update() throws Exception {
		msg = priorityService.updatePriority(srm, getCurrentOperator());
		message=msg.toString();
		return "ajax";
	}

	public PriorityQuery getPriorityQuery() {
		return priorityQuery;
	}

	public void setPriorityQuery(PriorityQuery priorityQuery) {
		this.priorityQuery = priorityQuery;
	}

	public Pagination<Priority> getPage() {
		return page;
	}

	public void setPage(Pagination<Priority> page) {
		this.page = page;
	}

	public Priority getPriority() {
		return priority;
	}

	public void setPriority(Priority priority) {
		this.priority = priority;
	}

	public Boolean getMsg() {
		return msg;
	}

	public SupplierRechargeMode getSrm() {
		return srm;
	}

	public void setSrm(SupplierRechargeMode srm) {
		this.srm = srm;
	}

	public void setMsg(Boolean msg) {
		this.msg = msg;
	}

}
